﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wicresoft.UnifyShow.Business
{
    public interface IDevice
    {
        List<DeviceModel> GetDeviceBySiteIDBSIDAndType(decimal siteID, decimal bsID, string type, string object1, string subobject);
        List<DeviceModel> GetServerBySiteIDBSID(decimal siteID, decimal bsID);

        List<DeviceAndAlertModel> GetDeviceBySiteIDBSIDAndTypeWithAlert(decimal siteID, decimal bsID, string type, string object1, string subobject);
        List<DeviceAndAlertModel> GetServerBySiteIDBSIDWithAlert(decimal siteID, decimal bsID);
        List<DeviceAndAlertModel> GetMiddleWareBySiteIDBSIDWithAlert(decimal siteID, decimal bsID);
        List<DeviceAndAlertModel> GetSQLServerBySiteIDBSIDWithAlert(decimal siteID, decimal bsID);

        List<DeviceAndAlertModel> GetDeviceBySiteIDAndTypeWithAlert(decimal siteID, string type, string object1, string subobject);
        List<DeviceAndAlertModel> GetServerBySiteIDWithAlert(decimal siteID);
        List<DeviceAndAlertModel> GetMiddleWareBySiteIDWithAlert(decimal siteID);
        List<DeviceAndAlertModel> GetSQLServerBySiteIDWithAlert(decimal siteID);
        List<DeviceAndAlertModel> GetNetworkBySiteIDWithAlert(decimal siteID);
        List<DeviceAndAlertModel> GetRoomBySiteIDWithAlert(decimal siteID);

        List<DeviceAndCount> GetDeviceAlertCountBySiteID(decimal siteID);

        DeviceModel GetDeviceByID(int deviceID);

        List<DeviceModel> GetDeviceByBSID(decimal bsID);
        List<DeviceModel> GetDevicePagedByBSID(decimal bsID, out Decimal totalRecords, string identify = "", string type = "", int pageSize = -1, int pageIndex = -1,
            string sortName = "CreateTime", string sortDirection = "Descending"/*Ascending,Descending*/);
        List<DeviceModel> GetNoBSIDDeviceByBSID(decimal bsID);

        int Add(DeviceModel model);
        void Delete(decimal id);
        void InitBsIdByDeviceId(decimal deviceid);
        void InitBsIdByBsId(decimal bsid);
        int Update(DeviceModel model);
        int UpdateNoBSID(DeviceModel model);
        DeviceSyncModel GetDeviceSyncModel(decimal deviceID);

        bool GetIsExistNoBSID(DeviceModel model);
        bool GetIsExist(DeviceModel model);

        List<BusinessDeviceModel> GetBusinessDeviceModel(int? siteid);
        List<BusinessDeviceModel> GetMyDevices(decimal UserId);
        int AddMyDevice(MyDeviceModel mydevice);
        int RemoveMyDevice(MyDeviceModel mydevice);
    }
}
